element = document.getElementById('test3');

            // 辅助函数：获取元素的scale值
            function getTransformScale(el) {
              var transform = window.getComputedStyle(el).transform || el.style.transform || 'none';
              var matrix = transform.match(/^matrix3d\((.+)\)$/);
              if (matrix) {
                  return parseFloat(matrix[1].split(', ')[0]) / 1; // sx
              } else {
                  var matrix2d = transform.match(/^matrix\((.+)\)$/);
                  return matrix2d ? parseFloat(matrix2d[1].split(', ')[0]) : 1; // 默认scale为1
              }
          }
// 保存旧的值
oldStyle = window.getComputedStyle(element);
oldWidth = parseFloat(oldStyle.width);
oldHeight = parseFloat(oldStyle.height);
oldLeft = element.offsetLeft; // 注意：offsetLeft 返回的是整数，单位px
oldTop = element.offsetTop; // 同上
oldMarginTop = parseFloat(oldStyle.marginTop);
oldMarginLeft = parseFloat(oldStyle.marginLeft);
oldScale = getTransformScale(element); // 获取当前的scale值

// 修改为新的值
element.style.width = '200px';
element.style.height = '200px';
element.style.left = '100px';
element.style.top = '100px';
element.style.marginTop = '40px';
element.style.marginLeft = '40px';
element.style.transform = 'scale(1.5)'; // 修改scale值

// 输出旧的值（这里只是为了演示，实际应用中你可能不需要这样做）
console.log('Old Width:', oldWidth, 'px');
console.log('Old Height:', oldHeight, 'px');
console.log('Old Left:', oldLeft, 'px');
console.log('Old Top:', oldTop, 'px');
console.log('Old Margin-Top:', oldMarginTop, 'px');
console.log('Old Margin-Left:', oldMarginLeft, 'px');
console.log('Old Scale:', oldScale);